<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 声明一个小米的产品对象
        let xiaomi = {
            goods: 'MI',
            goodsName: '小米小米10 青春版',
            goodsNum: '100012816024',
            goodsWeight: '0.55kg',
            goodsAddress: '中国大陆',
            'goods-id': '99780'
        }

        // 修改
        xiaomi.goodsName = '小米10 PLUS'
        // console.log(xiaomi);

        // 增加
        xiaomi.goodsColor = '粉色'
        console.log(xiaomi);

        // 查
        // 1》方法1
        console.log(xiaomi.goods);
        console.log(xiaomi.goodsName);
        console.log(xiaomi.goodsNum);
        console.log(xiaomi.goodsWeight);
        console.log(xiaomi.goodsAddress);
        console.log(xiaomi.goodsColor);
        // 2》方法2
        console.log(xiaomi['goods-id']);
        console.log(xiaomi['goodsColor']);
        // 删除
        delete xiaomi.goodsPrice
        // console.log(xiaomi);

    </script>
</body>

</html>